1
การแก้ปัญหาความคลาดเคลื่อน: วิธีการเปิดหนังสืออ้างอิง (RAG)
EvoClass-AI005Lecture 4
00:00

อุปสรรคหลักในการใช้ปัญญาประดิษฐ์ในสภาพแวดล้อมทางอาชีพคือ ปัญหาความคลาดเคลื่อน. ปรากฏขึ้นเมื่อโมเดลภาษาขนาดใหญ่ (LLM) มั่นใจในตนเองและสร้างข้อเท็จจริง วันที่ หรือการอ้างอิงขึ้นมาเอง เนื่องจากต้องพึ่งพาลักษณะของข้อมูลฝึกอบรมแทนที่จะใช้ข้อมูลที่ยืนยันแล้วแบบเรียลไทม์

1. จาก 'หนังสือปิด' สู่ 'หนังสือเปิด'

ผู้ใช้ больш่าส่วนใหญ่โต้ตอบกับปัญญาประดิษฐ์ในลักษณะ 'หนังสือปิด' ซึ่งโมเดลพึ่งพาแค่ค่าน้ำหนักภายใน (หน่วยความจำ) โดยตรง เพื่อให้ได้ความแม่นยำระดับมืออาชีพ เราจึงเปลี่ยนไปใช้ การสร้างเนื้อหาเสริมการดึงข้อมูล (RAG). วิธีการนี้ 'สอบแบบเปิดหนังสือ' จะให้ปัญญาประดิษฐ์เข้าถึงเอกสารเฉพาะและเกี่ยวข้องเพื่อใช้อ้างอิงก่อนที่จะสร้างคำตอบ

2. โมเดลภาษาขนาดใหญ่ในฐานะเครื่องมือคิดวิเคราะห์

ในกรอบการทำงานของ RAG โมเดลภาษาขนาดใหญ่จะหยุดทำหน้าที่เป็นฐานข้อมูลคงที่ และเริ่มทำหน้าที่เป็นเครื่องมือคิดวิเคราะห์ เมื่อคุณถามคำถาม ระบบจะดึงข้อความที่เกี่ยวข้องจาก 'สมองที่สอง' ของคุณ (ไฟล์ PDF และโน้ตที่คัดเลือกมา) มาใช้เป็นบริบท บทบาทของโมเดลเปลี่ยนจาก 'การจำจากความจำ' เป็น 'สรุปและรวมข้อมูลที่ให้มา' ซึ่งทำให้ผลลัพธ์มีรากฐานอยู่บนข้อมูลเฉพาะของคุณ ตามตรรกะ:

$$ \text{คำตอบ} = \text{LLM}(\text{คำถาม} + \text{บริบท}) $$

ลำดับตรรกะของ RAG
Question 1
Why do LLMs "hallucinate" in a professional context?
They are programmed to lie to the user.
They try to predict the next word based on outdated or insufficient training data.
They have too much access to real-time internet data.
Question 2
In the RAG methodology, what is the primary purpose of the "Context"?
To make the prompt longer and more expensive.
To provide a factual anchor that prevents the model from drifting into invention.
To teach the model a new language.
Challenge: Reducing Error Probability
Applying RAG principles to legal documents.
You need to use an AI to summarize a 50-page legal contract without it making up clauses.
Step 1
Identify the "Search Space" for the AI.
Solution:
Instead of asking general questions, upload the PDF to a RAG-enabled tool (like NotebookLM) to constrain the AI’s search space strictly to that specific document.